function validasiForm(theForm){
 var reason = "";
 
 reason += validasiUsr(theForm.admUsr);
 reason += validasiPsw(theForm.admPsw);
 
 if(reason != ""){
  alert("Maaf terjadi kesalahan dalam pengisian :\n" + reason);
  return false;
 }
 
 return true; 
}

function validasiUsr(fld){
 var error = "";
  
 if(fld.value == "") {
  fld.style.background = '#BBFFFF';
  error = "Field Username harus diisi !\n";
 }else if((fld.value.length <= 5) || (fld.value.length > 15)) {
  error = "Jumlah karakter pada field Username salah !\n";
  fld.style.background = '#BBFFFF';
 }else{
  fld.style.background = 'White';
 }
 
 return error;
}

function validasiPsw(fld){
 var error = "";
  
 if(fld.value == "") {
  fld.style.background = '#BBFFFF';
  error = "Field Password harus diisi !\n";
 }else if((fld.value.length <= 5) || (fld.value.length > 15)) {
  error = "Jumlah karakter pada field Password salah !\n";
  fld.style.background = '#BBFFFF';
 }else{
  fld.style.background = 'White';
 }
 
 return error;
}